/* Copyright (c) 2010-2020 Vadim Surov.
 */
package com.srv.client;

public class Globals {

	public static final int maxLinesInIcon = 4;

	public final static int cardWidth = 500;
	public final static int cardHeight = 500;

	public final static int MAXCARDS = 60;

	public final static boolean Visible = true;
	public final static boolean Hidden = false;

	public final static boolean Checked = true; 
	public final static boolean Unchecked = false; 

	public final static boolean Enabled = true; 
	public final static boolean Disabled = false; 

	public final static String html_GreenCheck = "<span style=\"width:20px;display:inline-block;margin-right:5px;color:green;font-weight:bold;\">&#10003;</span>";

	public final static String html_RedCross = "<span style=\"width:20px;display:inline-block;margin-right:5px;color:red;font-weight:bold;\">&#10007;</span>";

	public final static String html_NoComment = "<span style=\"width:20px;display:inline-block;margin-right:5px;\"></span>";

	public final static String html_body(String body) {	
		return "<table><tr>" + body + "</tr></table>";
	}

	public final static String html_TextArea(String text) {  
		return "<textarea style=\"font-family:Arial,Helvetica,sans-serif;border-style:dotted;width:99%;resize:vertical;\" tabindex=\"-1\">" + text + "</textarea>";
	}

	public final static String html_title(String title) {  
		return title.isEmpty()?"":"<span style=\"margin-right:5px;font-weight:bold;\">" + title + ":</span>";
	}

	public final static String html_comment(String text) { 
		return "<span style=\"margin-right:5px;\">" + text + "</span>";
	}

	public final static String html_image(String text) { 
		return "<div style=\"text-align:center\"><img src=\"" + text + "\" alt=\"Image\"/></div>";
	}

	public final static String html_Control(String name, String text) {
		return html_body("<td style=\"width:20px;\">" + html_title(name) + 
				"</td><td style=\"width:100%\">" + text + "</td>" );
	}
	
	public final static String html_Control_Image(String text) { 
		return html_body("<td>" + html_image(text) + "</td>" );
	}

	public final static String html_Control_Line =  
			html_body("<td><hr></td>");

	public final static String html_input(String name, String type, boolean checked, boolean enabled) { 
		return "<input style=\"margin-right:5px;\" type=\"" + type + "\" name=\"" + name + "\"" + 
				(checked?" checked=\"checked\"":"") + 
				(enabled?"":" disabled=\"disabled\"") +
				"/>";
	}

	public final static String html_Control_Input(String name, String type, String text, boolean checked, boolean enabled) { 
		return html_body( "<td style=\"width:20px;\">" + html_input(name, type, checked, enabled) + 
				"</td><td style=\"width:100%\">" + text + "</td>" );
	}
}
